package photon;

import math.Vecmath;
import ray.Ray;

public class Photon extends Ray
{
    
    private double[] color;
    public double[] getColor() { return this.color; }
    public void setColor(double[] col) { this.color = col; }
    
    public Photon(
            double[] lightColor, 
            double[] position, 
            double[] direction)
    {
        super(
            position, 
            direction
        );
        // Set color to the light's color
        this.color = Vecmath.getCopyOf(
            lightColor
        );
    }
    
    
    public double getEnergy()
    {
        double compSum = Vecmath.componentSum(this.color);
        double compAvg = 0.3333333 * compSum;
        return compAvg;
    }
    
}
